package com.shop2cn.iapi.wxcomponent.parameter;

/**
 * @ClassName :CodeReviewEnum
 * @Author :MrCao
 * @Description : 代码审核枚举类
 * @Date : Create in 11:46 2019/12/5
 * @Modified BY:
 */
public enum AuditStatusEnum {

    WEAPP_AUDIT_DURING(0,"","审核中"),

    WEAPP_AUDIT_SUCCESS(1,"weapp_audit_success", "审核通过"),

    WEAPP_AUDIT_FAIL(2,"weapp_audit_fail", "审核不通过"),

    WEAPP_AUDIT_DELAY(3,"weapp_audit_delay", "审核延后"),

    WEAPP_AUDIT_WITHDRAW(4,"", "审核撤回");



    private int code;
    private String value;
    private String message;

    AuditStatusEnum(int code, String value, String message) {
        this.code = code;
        this.value = value;
        this.message = message;
    }

    /**
     * 通过代码获取枚举项
     *
     * @param code
     * @return
     */
    public static AuditStatusEnum getByCode(int code) {
        for (AuditStatusEnum auditStatusEnum : AuditStatusEnum.values()) {
            if (auditStatusEnum.getCode() == code) {
                return auditStatusEnum;
            }
        }
        return null;
    }

    /**
     * 通过代值获取枚举项
     *
     * @param value
     * @return
     */
    public static AuditStatusEnum getByValue(String value) {
        for (AuditStatusEnum auditStatusEnum : AuditStatusEnum.values()) {
            if (auditStatusEnum.getValue().equals(value.trim())) {
                return auditStatusEnum;
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
